package com.hatricks.base;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @packageName: com.hatricks.base
 * @className: PolymorphicCase
 * @author: yanyuhui
 * @date: 2022/7/5 23:58
 * @description:
 */
public class PolymorphicCase {

    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("key1", "value1");
        map.put("key2", "value2");
        System.out.println(map);
        // 被替换之后的既为
        map = new LinkedHashMap<>();
        map.put("key1", "value1");
        map.put("key2", "value2");
        System.out.println(map);
    }

}
